package com.budayi.controller;

import com.budayi.common.utils.JsonResult;
import com.budayi.entity.Menu;
import com.budayi.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LIBOFEI
 * @ClassName MenuController
 * @description 菜单控制层
 * @date 2021/4/27 15:34
 * @Version 1.0
 **/
@RestController
@RequestMapping("/admin/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;


    @RequestMapping("/getAll")
    public Object getAllMenu(){
        return menuService.queryObjectListByCondition(new Menu());
    }


    @RequestMapping("/getAllByParent")
    public JsonResult getAllMenuByParent(){
        return JsonResult.success(menuService.queryMenuByParent(new Menu()));
    }
}
